﻿<%@ Page Title="" Language="C#" Theme="Default_Themes" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="AcountManager.aspx.cs" Inherits="DanhMuc_AcountManager" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
    <div class="row-fluid">
        <div class="span12">
            <div class="box">
                <div class="box-title">
                    <h3><i class="icon-file"></i>Quản lý tài khoản</h3>
                    <div class="box-tool">
                        <a data-action="collapse" href="#"><i class="icon-chevron-up"></i></a>
                        <a data-action="close" href="#"><i class="icon-remove"></i></a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div style="background-color:white;">
        <asp:UpdatePanel ID="udt1" runat="server">
            <ContentTemplate>
                <div class="row-fluid" style="border:solid 1px #b6d1f2">
                    <div class="span6">
                        <div class="box">
                            <div class="box-content">
                                <div class="control-group info">
                                    <label class="control-label" style="width:160px;padding-right:10px;">Tên Hiển thị <span style="color:red;">(*)</span></label>
                                    <div class="controls">
                                        <asp:TextBox ID="txtid" runat="server" Visible="false"></asp:TextBox>
                                        <asp:TextBox ID="txttenhienthi" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                                    </div>
                                    <div style="height:5px;"></div>
                                    <label class="control-label" style="width:160px;padding-right:10px;">Email </label>
                                    <div class="controls">
                                        <asp:TextBox ID="txtemail" runat="server" CssClass="span12" onblur="KiemTraInjectionDangNhap(this);"></asp:TextBox>
                                    </div>
                                    <div style="height:5px;"></div>
                                    <label class="control-label" style="width:160px;padding-right:10px;">Đơn vị <span style="color:red;">(*)</span></label>
                                    <div class="controls">
                                        <asp:DropDownList ID="drldonvi" runat="server" CssClass="span12" Height="25px"></asp:DropDownList>
                                    </div>
                                    <div style="height:5px;"></div>
                                    <label class="control-label" style="width:160px;padding-right:10px;">Tên đăng nhập <span style="color:red;">(*)</span></label>
                                    <div class="controls">
                                        <asp:TextBox ID="txttendangnhap" runat="server" CssClass="span12" onblur="KiemTraInjection(this);"></asp:TextBox>
                                    </div>
                                    <div style="height:5px;"></div>
                                    <label class="control-label" style="width:160px;padding-right:10px;">Mật khẩu <span style="color:red;">(*)</span></label>
                                    <div class="controls">                                      
                                        <asp:TextBox ID="txtmakhau" TextMode="Password" runat="server" CssClass="span12" onblur="KiemTraInjectionDangNhap(this);"></asp:TextBox>
                                    </div>
                                    <div style="height:5px;"></div>
                                    <label class="control-label" style="width:160px;padding-right:10px;">Xác nhận mật khẩu<span style="color:red;">(*)</span></label>
                                    <div class="controls">
                                        <asp:TextBox ID="txtxacnhanmatkhau" TextMode="Password" runat="server" CssClass="span12" onblur="KiemTraInjectionDangNhap(this);"></asp:TextBox>
                                    </div>
                                    <div style="height:5px;"></div>
                                    <label class="control-label" style="width:160px;padding-right:10px;">Cấp quyền đăng nhập</label>
                                    <div class="controls">
                                        <asp:CheckBox ID="chkgrant" runat="server" />
                                    </div>
                                </div>
                                <div class="button_sign" style="text-align:left;"> 
                                    <asp:Button ID="btnadd" runat="server" Text="Thêm mới" Width="100px" CssClass="btn btn-primary" OnClick="btnadd_Click" />
                                    <asp:Button ID="btnsave" runat="server" Text="Lưu" Width="100px" CssClass="btn btn-primary" OnClick="btnsave_Click" />
                                    <asp:Button ID="btnedit" runat="server" Text="Sửa" Width="100px" CssClass="btn btn-primary" OnClick="btnedit_Click"/>
                                    <asp:Button ID="btndelete" runat="server" Text="Xóa" Width="100px" CssClass="btn btn-primary" OnClick="btndelete_Click" OnClientClick="return confirm('Bạn có chắc xóa không?')"/>
                                    <asp:Button ID="btngrant" runat="server" Text="Phân quyền" Width="100px" CssClass="btn btn-primary" OnClick="btngrant_Click" />
                                    <asp:Label ID="statusLabel" runat="server" ForeColor="Red"></asp:Label>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="span6">
                        <div class="box">
                            <div id="dvParent" class="box-content">
                                <asp:GridView ID="grid" EnableTheming="True" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" OnRowDeleting="grid_RowDeleting">
                                    <Columns>
                                        <asp:TemplateField HeaderText="Chọn">
                                            <ItemTemplate>
                                                <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                                                    CommandName="Delete" Text="Chọn"></asp:LinkButton>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Số thứ tự" SortExpression="stt">
                                            <ItemTemplate>
                                                <%# Container.DataItemIndex + 1 %>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" HorizontalAlign="Center" VerticalAlign="Middle" Width="50px" />
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Tên Đăng Nhập" SortExpression="TenDangNhap">
                                            <ItemTemplate>
                                                <%# Eval("TenDangNhap") %>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" VerticalAlign="Middle"/>
                                        </asp:TemplateField>
                                        <asp:TemplateField HeaderText="Tên Hiển Thị" SortExpression="TenHienThi">
                                            <ItemTemplate>
                                                <%# Eval("TenHienThi") %>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" VerticalAlign="Middle"/>
                                        </asp:TemplateField>
                                         <asp:TemplateField HeaderText="Đơn Vị" SortExpression="DonVi">
                                            <ItemTemplate>
                                                <%# Eval("DonVi") %>
                                            </ItemTemplate>
                                            <ItemStyle CssClass="ItemGridCell" VerticalAlign="Middle"/>
                                        </asp:TemplateField>
                                    </Columns>
                                </asp:GridView>
                            </div>
                        </div>
                    </div>
                </div>
            </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="btnadd" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnsave" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btngrant" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btndelete" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="btnedit" EventName="Click" />
                <asp:AsyncPostBackTrigger ControlID="grid" EventName="RowDeleting" />
            </Triggers>
        </asp:UpdatePanel>
    </div>
    <br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br><br>
</asp:Content>

